package com.yonyou.le.unattended.util;

import com.yonyou.le.unattended.delivery.enumeration.DevicePositionEnum;
import com.yonyou.le.unattended.delivery.enumeration.DevtypeEnum;

/**
 * 根据设备位置和类型找设备KEY
 * @author zhangbbd
 * @version 创建时间：2017年5月26日 下午4:03:32
 */
public class FindDevice {
	public static final String NONE_POSITION="NONE_POSITION";

	/**
	 * 通用获取KEY
	 * @param positionEnum
	 * @param typeEnum
	 * @return
	 */
	public static String getDevicePositonAndType(DevicePositionEnum positionEnum,DevtypeEnum typeEnum){
    	return positionEnum.getIndex()+"-"+typeEnum.getIndex();
    }
	/**
	 * 通用获取KEY
	 * @param pos
	 * @param typeEnum
	 * @return
	 */
	public static String getDevicePositonAndType(String pos,DevtypeEnum typeEnum){
    	return pos+"-"+typeEnum.getIndex();
    }
	/**
	 * 衡器
	 * @return
	 */
    public static String getWeightPositionAndType(){
    	return "E-E";
    }
    /**
     * 无位置设备
     * @param typeEnum
     * @return
     */
    public static String getNonepositionDevice(DevtypeEnum typeEnum){
    	return NONE_POSITION+"-"+typeEnum.getIndex();
    }
    /**
     * 无位置设备
     * @param typeEnum
     * @return
     */
    public static String getNonepositionType(Integer hfdevtype){
    	return  NONE_POSITION+"-"+hfdevtype;
    }
	/**
	 * 前置红外
	 * @return
	 */
	public static String getHongWai_Before(){
		return DevicePositionEnum.WEIGH_FRONT.getIndex()+"-"+DevtypeEnum.FDIEnum.getIndex();
	}
	/**
	 * 后置红外
	 * @return
	 */
	public static String getHongWai_After(){
		return DevicePositionEnum.WEIGH_AFTER.getIndex()+"-"+DevtypeEnum.FDIEnum.getIndex();
	}
	/**
	 * 前置道闸
	 * @return
	 */
	public static String getDaoZha_Before(){
		return DevicePositionEnum.WEIGH_FRONT.getIndex()+"-"+DevtypeEnum.FDOEnum.getIndex();
	}
	
	/**
	 * 后置道闸
	 * @return
	 */
	public static String getDaoZha_After(){
		return DevicePositionEnum.WEIGH_AFTER.getIndex()+"-"+DevtypeEnum.FDOEnum.getIndex();
	}
	
	/**
	 * 前置摄像头
	 * @return
	 */
	public static String getCamera_Before(){
		return DevicePositionEnum.WEIGH_FRONT.getIndex()+"-"+DevtypeEnum.FShowEnum.getIndex();
	}
	
	/**
	 * 后置摄像头
	 * @return
	 */
	public static String getCamera_After(){
		return DevicePositionEnum.WEIGH_AFTER.getIndex()+"-"+DevtypeEnum.FShowEnum.getIndex();
	}
	
	/**
	 * 前置LED
	 * @return
	 */
	public static String getLED_Before(){
		return DevicePositionEnum.WEIGH_FRONT.getIndex()+"-"+DevtypeEnum.FShowEnum.getIndex();
	}
	
	/**
	 * 后置LED
	 * @return
	 */
	public static String getLED_After(){
		return DevicePositionEnum.WEIGH_AFTER.getIndex()+"-"+DevtypeEnum.FShowEnum.getIndex();
	}
}
